// import { getApiData } from "src/tools/HttpClient";
import { getApiData } from "../../../tools/HttpClient";
// 获取账套
export async function getAccountInfo(params) {
    if (!params.dbname)
        return [];
    const res = await getApiData("account.accountInfo.getDataList", params);
    if (res.ok) {
        return Promise.resolve({
            data: res.data,
            success: true,
        });
    }
    return Promise.resolve({
        data: [],
        success: false,
    });
}
// 获取账套
export async function getPresetTopSubject(params) {
    if (!params.dbname)
        return [];
    const res = await getApiData("account.subject.getPresetTopSubjectList", params);
    if (res.ok) {
        return Promise.resolve({
            data: res.data,
            success: true,
        });
    }
    return Promise.resolve({
        data: [],
        success: false,
    });
}
// 增加科目
export async function Addsubject(params) {
    const res = await getApiData("account.subject.add", params);
    return res;
}
// 获取左侧切换的数据
export async function getSubjectType(params) {
    const res = await getApiData("account.subject.getType", params);
    if (res.ok) {
        return Promise.resolve({
            data: res.data,
            success: true,
        });
    }
    return Promise.resolve({
        data: [],
        success: false,
    });
}
